package cn.edu.ntu.yyl.dao;

import cn.edu.ntu.yyl.pojo.article.Article;
import cn.edu.ntu.yyl.pojo.article.ArticleCategory;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Repository;

import java.util.List;
@Mapper
@Repository
public interface ArticleCategoryDao {
    //分类
    // 增
    Integer AddNewCategory(ArticleCategory articleCategory);
    // 删
    Integer DeleteCategory(ArticleCategory articleCategory);
    // 改
    Integer UpdateCategory(ArticleCategory articleCategory);
    // 查
    List<ArticleCategory> SelectCategory();
    //按照ID查询
    ArticleCategory SelectCategoryById(Integer id);
    //查询父分类
    ArticleCategory SelectCategoryFather(ArticleCategory articleCategory);
    //查询子分类
    List<ArticleCategory> SelectCategoryChildren(ArticleCategory articleCategory);
    //查询文章的分类
    ArticleCategory SelectCategoryByArticle(Article article);

    //标签
    // 增
    Integer AddNewTag(ArticleCategory articleCategory);
    // 删
    Integer DeleteTag(ArticleCategory articleCategory);
    // 改
    Integer UpdateTag(ArticleCategory articleCategory);
    // 查
    List<ArticleCategory> SelectTag();
    //查询文章的标签
    List<ArticleCategory> SelectTagByArticle(Article article);
    //按照ID查询
    ArticleCategory SelectTagById(Integer id);
    //为文章添加分类(标签)
    Integer AddArticleCategory(Integer categoryid,Integer articleid);
    //为文章删除分类(标签)
    Integer DeleteArticleCategory(Integer categoryid,Integer articleid);
    //修改文章的分类(标签)
    Integer UpdateArticleCategory(Integer categoryid,Integer articleid);
    //查询所有
    List<ArticleCategory> SelectAll();


}
